package com.zhang.servicedriveruser.generator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 类功能描述
 * 通过数据库代码生成
 *
 * @author Kye
 * @date 2025-04-12
 */
public class MysqlGenerator {
	public static void main(String[] args) {
		FastAutoGenerator.create("jdbc:mysql://192.168.150.105:3306/service-dirver-user?characterEncoding=utf-8&serverTimezone=GMT%2B8", "root", "root")
				.globalConfig(builder -> {
					builder.author("张开琦").fileOverride().outputDir("D:\\GW-Synergetic-Transport-Nexus\\service_driver_user\\src\\main\\java");
				}).packageConfig(builder -> {
					builder.parent("com.zhang.servicedriveruser").pathInfo(Collections.singletonMap(OutputFile.mapperXml,
							"D:\\GW-Synergetic-Transport-Nexus\\service_driver_user\\src\\main\\java\\com\\zhang\\servicedriveruser\\mapper"));
				}).strategyConfig(builder -> {
					builder.addInclude("driver_user_work_status");
				}).templateEngine(new FreemarkerTemplateEngine()).execute();
	}
}
